package com.example.demo.example;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

@RestController
public class WebSocketController {

    @RequestMapping(value = "/getTest")
    public Map<String, Object> pushVideoListToWeb(String userId) {
        Map<String, Object> result = new HashMap<String, Object>();

        try {
            WebSocketServer.sendMessageByUserId2(userId,userId+"已经接受到消息了");
//            WebSocketServer.sendInfo("有新客户呼入,sltAccountId:");
            result.put("operationResult", true);
        } catch (IOException e) {
            result.put("operationResult", true);
        }
        return result;
    }

}
